FROM openjdk:8-jre-slim

#在build镜像时可以通过 --build-args profile=xxx 进行修改
ARG project
ENV PROJECT="${project}"

ARG java_opts
ENV JAVA_OPTS="${java_opts}"

ENV WORKSPACE="opt"

ENV TZ=PRC

WORKDIR /$WORKSPACE

COPY ./docker-entrypoint.sh /opt/source/
COPY ./$PROJECT.jar /opt/app/$PROJECT.jar

RUN cp /opt/source/docker-entrypoint.sh /usr/bin/ \
 && chmod a+x /usr/bin/docker-entrypoint.sh \
 && rm -f -rf /opt/source \
 && ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

EXPOSE 8080

ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"]
